const {
  getEventData
} = getApp()
Component({
  properties: {
    filterData: Array,
    valueKey: String,
    nodeKey: String,
  },

  data: {
    active: '',
    scrollLeft: 0
  },

  methods: {
    handleClickItem(event) {
      const {
        active
      } = getEventData(event)
      const offsetLeft = event.currentTarget.offsetLeft;
      const width = wx.getSystemInfoSync().windowWidth;
      this.setData({
        scrollLeft: offsetLeft - width / 2.5,
        active
      })

      this.triggerEvent('change', this.data.active)
    }
  }
})